

cmake_minimum_required( VERSION 2.6 )
project( CV_IMG_DIFFs )

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")



include_directories( ${PROJECT_SOURCE_DIR} )

######################################################### third lib / build flag
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -g -fpermissive")

find_package( OpenCV REQUIRED )
include_directories( ${OPENCV_INCLUDE_DIRS} )
message(STATUS "opencv lib:  ${OpenCV_LIBS} ")


find_package( Boost COMPONENTS system date_time)
include_directories( ${Boost_INCLUDE_DIRS} ) 
message(STATUS "opencv lib:  ${OpenCV_LIBS} opencl lib: ${OPENCL_LIBRARIES}")


find_package( OpenCL QUIET )
message(STATUS "opencl found: ${OPENCL_FOUND}")
if(${OPENCL_FOUND} STREQUAL "TRUE" )
	add_definitions(-DUSE_CL_DETECTION)  
	include_directories( ${OPENCL_INCLUDE_DIRS} )
	message(STATUS "opencl lib: ${OPENCL_LIBRARIES}")
	
else()
	message(STATUS "opencl not found / ubuntu will disable OPENCL")
endif()


######################################################### 
#find_library()




######################################################### link
add_executable(cv_utils_imgdiff  imgdiff.cpp)
target_link_libraries( cv_utils_imgdiff ${OpenCV_LIBS} ${Boost_LIBRARIES})

if(${OPENCL_FOUND} STREQUAL "TRUE" )
	target_link_libraries( cv_utils_imgdiff ${OPENCL_LIBRARIES} )
endif()

		
add_executable(fast  fast.cpp)
target_link_libraries( fast ${OpenCV_LIBS} ${Boost_LIBRARIES})

add_executable(surf  surf.cpp)
target_link_libraries( surf ${OpenCV_LIBS} ${Boost_LIBRARIES})

add_executable(switchMon  switchMon.cpp)
target_link_libraries( switchMon ${OpenCV_LIBS} ${Boost_LIBRARIES})

add_executable(opticalFlow  opticalFlow.cpp)
target_link_libraries( opticalFlow ${OpenCV_LIBS} ${Boost_LIBRARIES})

add_executable(face_similiar  face_similar.cpp)
target_link_libraries( face_similiar ${OpenCV_LIBS} ${Boost_LIBRARIES})

